<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台登录-X-admin1.1</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__PUBLIC__/admin/css/font.css">
    <link rel="stylesheet" href="__PUBLIC__/admin/css/xadmin.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="__PUBLIC__/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__PUBLIC__/admin/js/xadmin.js"></script>

</head>
<body>
    <!-- 中部开始 -->
    <div class="wrapper">
        <!-- 右侧主体开始 -->
        <div class="page-content">
          <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <form class="layui-form">
                <div class="layui-input-inline" style="padding-left: 35px;">
                    <span>
                        <if condition="$rz['rztype'] eq 2">学校认证
                        <elseif condition="$rz['rztype'] eq 3"/>企业认证
                        <elseif condition="$rz['rztype'] eq 4"/>慈善认证
                        <elseif condition="$rz['rztype'] eq 1"/>个人认证
                        <else />此用户未提交认证资料
                        </if>
                    </span>：
                    <?php if ($rz['is_rz']==1) {?>
                        <a onclick="no_rzinfo(this,<?php echo $rz['id']?>)" onmouseover="layer.msg('确定信息正确,就可以点击取消认证',{icon:6});" class="layui-btn">已认证</a> 
                    <?php }else { ?>
                        <a onclick="yes_rzinfo(this,'{$rz.id}')" onmouseover="layer.msg('确定信息正确,就可以点击确认认证',{icon:6});" class="layui-btn" style="background: red;">未认证</a> 
                    <?php } ?>
                    <span style="font-size: 8px;color: red;padding-left: 20px;">慎重提示：一定要用户认证通过后项目才能上线</span>
                </div>
                <?php if (!empty($rz)) { ?>
                <div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">
                    <if condition="($rz['rztype'] eq 3) OR ($rz['rztype'] eq 4)">法人代表:<else />真实姓名:</if>
                    </label>
                    <div class="layui-input-inline"><input type="text" autocomplete="off" name="sfzname" value="{$rz.sfzname}" class="layui-input"></div>
                </div>
                <div class="layui-form-item">
                    <label for="L_city" class="layui-form-label"><if condition="($rz['rztype'] eq 3) OR ($rz['rztype'] eq 4)">证件号码:<else />身份证号:</if></label>
                    <div class="layui-input-inline"><input type="text" autocomplete="off" name="sfznum" value="{$rz.sfznum}" class="layui-input"></div>
                </div>
                <div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">{$rz['rztype']==2?'所在学校':'所在单位'}:</label>
                    <div class="layui-input-inline"><input type="text" autocomplete="off" name="gsname" value="{$rz.gsname}" class="layui-input"></div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label for="L_sign" class="layui-form-label">个人简介:</label>
                    <div class="layui-input-inline">
                        <textarea placeholder="输入个人简介" name="jianjie" autocomplete="off" class="layui-textarea" style="min-height: 80px;width: 325px;">{$rz.jianjie}</textarea>
                    </div>
                </div>
                <if condition="$rz['rztype'] eq 3">
                    <div class="layui-form-item" style="padding: 10px 38px;margin: 0px;">
                        <span>营业执照:</span>
                        <?php if (empty($rz['sfzz'])) { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">未上传</span>
                        <?php }else { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">已上传</span>
                        <?php } ?>
                        <div>
                            <div style="float: left;">
                                <img id="LAY_demo_uploadz" src="<?php if ($rz['sfzz']) { ?> __ROOT__{$rz['sfzz']}<?php }else { ?>__PUBLIC__/home/images/qt/sfz1.png<?php }?>" alt="" style="width: 100%;">
                            </div>
                        </div>
                    </div>
                <elseif condition="$rz['rztype'] eq 4"/>
                    <div class="layui-form-item" style="padding: 10px 38px;margin: 0px;">
                        <span>登记证书:</span>
                        <?php if (empty($rz['sfzz'])) { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">未上传</span>
                        <?php }else { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">已上传</span>
                        <?php } ?>
                        <div>
                            <div style="float: left;">
                                <img id="LAY_demo_uploadz" src="<?php if ($rz['sfzz']) { ?> __ROOT__{$rz['sfzz']}<?php }else { ?>__PUBLIC__/home/images/qt/sfz1.png<?php }?>" alt="" style="width: 100%;">
                            </div>
                        </div>
                    </div>
                <else />
                    <div class="layui-form-item" style="padding: 10px 38px;margin: 0px;">
                        <span>身份证正面:</span>
                        <?php if (empty($rz['sfzz'])) { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">未上传</span>
                        <?php }else { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">已上传</span>
                        <?php } ?>
                        <div>
                            <div style="float: left;">
                                <img id="LAY_demo_uploadz" src="<?php if ($rz['sfzz']) { ?> __ROOT__{$rz['sfzz']}<?php }else { ?>__PUBLIC__/home/images/qt/sfz1.png<?php }?>" alt="" style="width: 100%;">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item" style="padding: 10px 38px;margin: 0px;">
                        <span>身份证反面:</span>
                        <?php if (empty($rz['sfzf'])) { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">未上传</span>
                        <?php }else { ?>
                            <span style="position: relative;left: 80%;font-size: 8px;">已上传</span>
                        <?php } ?>
                        <div>
                            <div style="float: left;">
                                <img id="LAY_demo_uploadf" src="<?php if ($rz['sfzf']) { ?> __ROOT__$rz['sfzf']<?php }else { ?>__PUBLIC__/home/images/qt/sfz2.png<?php }?>" alt="" style="width: 100%;">
                            </div>
                        </div>
                    </div>
                </if>
                <?php }?>

                <!-- <div class="layui-form-item" style="padding-left: 40px;">
                    <button class="layui-btn" key="set-mine" lay-filter="save" lay-submit>保存</button>
                </div> -->
            </form>
            <!-- 右侧内容框架，更改从这里结束 -->
          </div>
        </div>
        <!-- 右侧主体结束 -->
    </div>
    <!-- 中部结束 -->
        <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
              
            });

        /*zt rz*/
        function yes_rzinfo(obj,id){
            layer.confirm('确认要认证吗？',function(index){
                //发异步删除数据
                rzid = id;
                $.ajax({
                    url: "{:U('admin/user/yesrz')}",//请求地址
                    type: "post",//请求方式
                    dataType: "json",//返回数据类型
                    data: {rzid:rzid},//发送的参数
                    })
                    .done(function(response) {
                          if(response.error==1){
                            layer.msg(response.info ,{icon:6});
                            location.reload();
                          }else{
                            layer.msg(response.info ,{icon:5});
                          }
                      })
                    .fail(function() {
                        alert("ajxs交互失败");
                    })  
                return false;
            });
        }
        function no_rzinfo(obj,id){
            layer.confirm('确认要取消认证吗？',function(index){
                //发异步删除数据
                rzid = id;
                $.ajax({
                    url: "{:U('admin/user/norz')}",//请求地址
                    type: "post",//请求方式
                    dataType: "json",//返回数据类型
                    data: {rzid:rzid},//发送的参数
                    })
                    .done(function(response) {
                          if(response.error==1){
                            layer.msg(response.info ,{icon:6});
                            location.reload();
                          }else{
                            layer.msg(response.info ,{icon:5});
                          }
                      })
                    .fail(function() {
                        alert("ajxs交互失败");
                    })  
                return false;
            });
        }

        </script>
</body>
</html>